#include <stdio.h>

int main( )
{
    int n, k;
    scanf("%d", &k);
    while ( k-- )
    {
        int sum = 0;
        scanf("%d", &n);
        while ( n )
        {
            n /= 5;
            sum += n;
        }
        printf("%d\n", sum);
    }
    return 0;
}
